<template>
  <div>
    <img :src="program.coverUrl" alt="" />
    <!-- 数据嵌套过深,模板监听不到 -->
    <p v-if="program.radio">{{ program.radio.name }}</p>
    <p v-if="item.obj">{{ item.obj.name }}</p>
  </div>
</template>

<script setup>
import { useDetailHook } from "./Hooks/useDetailHook";
const { program } = useDetailHook();
import axios from "axios";
let item = ref({});
onMounted(() => {
  axios.get("http://127.0.0.1:5500/test/api.json").then((res) => {
    console.log(res);
    item.value = res;
  });
});
</script>

<style scoped>
img {
  width: 100px;
}
</style>
